package ui;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;

public class TabFolder extends Composite {

	
	private TabFolderItem currnTabFolderItem;
	private Color defaultColor = new Color(getDisplay(), 59,209,161);
	
	public TabFolder(Composite parent, int style) {
		super(parent, style);
		RowLayout rl_tabFolder = new RowLayout(SWT.HORIZONTAL);
		rl_tabFolder.pack = false;
		rl_tabFolder.spacing = 64;
		rl_tabFolder.wrap = false;
		rl_tabFolder.marginTop = 0;
		rl_tabFolder.marginRight = 0;
		rl_tabFolder.marginLeft = 16;
		rl_tabFolder.marginBottom = 0;
		setLayout(rl_tabFolder);
	}
	
	public boolean isCurrnTabFolderItem(TabFolderItem tabFolderItem) {
		return currnTabFolderItem == tabFolderItem;
	}
	
	public void setCurrentTabFolderItem(TabFolderItem tabFolderItem) {
		this.currnTabFolderItem = tabFolderItem;
	}
	
	public TabFolderItem getCurrentTabFolderItem() {
		return currnTabFolderItem;
	}
	
	public void setDefaultColor(Color color) {
		this.defaultColor = color;
	}
	
	public Color getDefaultColor() {
		return defaultColor;
	}
	
	@Override
	public void setFont(Font font) {
		Control[] childrens = getChildren();
		for (Control control : childrens) {
			control.setFont(font);
		}
	}
}
